package com.woniuxy.productServer.client;

import com.woniuxy.cinemaServer.form.seatInfo.SeatLoadForm;
import com.woniuxy.cinemaServer.model.SeatInfo;
import com.woniuxy.commons.util.Result;
import com.woniuxy.productServer.client.model.CinemaInfo;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;
import java.util.Map;


@FeignClient(name = "cinema-server",path = "/cinema")
public interface CinemaClient {


    @GetMapping("/cinemaInfo/loadById/{id}")
    public Result<CinemaInfo> loadCinemaById(@PathVariable("id") Integer id);

    @LoadBalanced
    @PostMapping("/seatInfo/loadSeatByCinemaId.api")
    public Result<Map<Integer,List<SeatInfo>>> loadSeatByCinemaIds(@RequestBody List<Integer> ids);

    @LoadBalanced
    @PostMapping("/cinemaInfo/loadByIds.api")
    public Result<List<CinemaInfo>> loadCinemaByIds(@RequestBody List<Integer> ids);
}
